
// !!common.checkAppResult?$("#header").hide():null; //此代码用来解决在部分APP下出现的双标题问题，如果需要解开本行注释即可
var rowKey=common.getQueryString('id');
var $sliderPanel=$(".slider-panel");
var $sliderImageList=$("#detail-images");
var $counting=$(".counting");
var globalHost=common.globalHost;
var detailPort=common.getSaleHouseById;
var url=globalHost+detailPort;
var sendData={villageId:rowKey};
var $recommend=$("#push-list");
$(".back").on("touchend", function (e) {
    e.preventDefault();
    e.stopPropagation();
    window.history.back();
});
requestData();

function requestData() {
    $.ajax({
        data:sendData,
        type: "POST",
        contentType: "application/x-www-form-urlencoded;charset=utf-8",
        dataType:"json",
        url:url,
        success:function(data){
            data=typeof data==="string"?data=JSON.parse(data):data;
            // console.log(data)
            var salePhotoList=[];
            if(data['imgDetailLink']!=null){
                salePhotoList=data['imgDetailLink'].split(";");
                salePhotoList.pop();
            };
            // var salePhotoList=data['imgDetailLink'];
            common.buildNormalSwipe({
                sliderPanel:$sliderPanel,
                imgPath:"",
                countingType:"number",
                data:salePhotoList,
                autoPlay:true
            });
            $("#title").html(data['villageName']);
            $("#villageName").html(data['villageName']);
            $.each(data,function (key,value) {
                if(value===null||value===""){
                    value="暂无";
                    $("#"+key).html(value);
                }else{
                    $("#"+key).html(value);
                }
                
            });
        },
        timeout:10000,
        error: function (XMLHttpRequest, textStatus, errorThrown) {
            // changeMsg($notice,"网络不畅，请稍后重试");
            historyControl.errDialog("网络不畅，请稍后重试");
        }
    });
}
